import request from '@/utils/request'

// export function getAllFoods(id) {
//   return request({
//     url: '/community/ec/foods/' + id,
//     method: 'get'
//   })
// }

export function getAllFoods(query) {
  return request({
    url: '/community/ec/foods',
    method: 'get',
    params: query
  })
}

export function addFood(food) {
  return request({
    url: '/community/ec/food',
    method: 'post',
    data: food
  })
}

export function updateFood(food) {
  return request({
    url: '/community/ec/food',
    method: 'put',
    data: food
  })
}
